package balmysundaycandy.webtest.more.low.level.check.mail;

import com.google.appengine.api.mail.MailServicePb.MailMessage;
import com.google.apphosting.api.ApiProxy;

import balmysundaycandy.more.low.level.mail.MailOperations;
import balmysundaycandy.test.AppengineEnvironmentTestCase;

public class MailExecutableCheck extends AppengineEnvironmentTestCase {
	public void testSend() {
		MailMessage request = new MailMessage();
		{
			request.setSender(ApiProxy.getCurrentEnvironment().getEmail());

			request.addTo(ApiProxy.getCurrentEnvironment().getEmail());
			
			request.setSubject("this is unit test from appengine");
			request.setHtmlBody("body");
		}
		MailOperations.SEND.call(request);
	}

	public void testSentToAdmins() {
		MailMessage request = new MailMessage();
		{
			request.setSender(ApiProxy.getCurrentEnvironment().getEmail());

			request.setSubject("this is unit test from appengine, to admins");
			request.setHtmlBody("body");
		}
		MailOperations.SEND_TO_ADMINS.call(request);
	}
}
